INCLUDE("@CMAKE_SOURCE_DIR@/cmake/ToNativePath.cmake")

# Translations
SET(QM_FILES "@QM_FILES@")
SET(INSTALL_TRANSLATIONS "")
FOREACH(file ${QM_FILES})
	TO_NATIVE_PATH("${file}" file)
	SET(INSTALL_TRANSLATIONS "${INSTALL_TRANSLATIONS}\n  File \"${file}\"")
ENDFOREACH()

# Imageformat plugins for Qt
SET(IMAGEFORMAT_PLUGINS_Debug "@QT_QJPEG_PLUGIN_DEBUG@")
SET(IMAGEFORMAT_PLUGINS_Release "@QT_QJPEG_PLUGIN_RELEASE@")
SET(IMAGEFORMAT_PLUGINS_MinSizeRel "@QT_QJPEG_PLUGIN_RELEASE@")
SET(IMAGEFORMAT_PLUGINS_RelWithDebInfo "@QT_QJPEG_PLUGIN_RELEASE@")
SET(INSTALL_IMAGEFORMAT_PLUGINS "")
FOREACH(file ${IMAGEFORMAT_PLUGINS_${CFG}})
	TO_NATIVE_PATH("${file}" file)
	LIST(
		APPEND INSTALL_IMAGEFORMAT_PLUGINS
		"${INSTALL_IMAGEFORMAT_PLUGINS}\nFile \"${file}\""
	)
ENDFOREACH()

# Extra binaries (DLLs)
SET(COPY_TO_BUILD_DIR_Debug "@COPY_TO_BUILD_DIR_Debug@")
SET(COPY_TO_BUILD_DIR_Release "@COPY_TO_BUILD_DIR_Release@")
SET(COPY_TO_BUILD_DIR_MinSizeRel "@COPY_TO_BUILD_DIR_MinSizeRel@")
SET(COPY_TO_BUILD_DIR_RelWithDebInfo "@COPY_TO_BUILD_DIR_RelWithDebInfo@")

SET(INSTALL_EXTRA_BINARIES "")
FOREACH(file ${COPY_TO_BUILD_DIR_${CFG}})
	TO_NATIVE_PATH("${file}" file)
	SET(INSTALL_EXTRA_BINARIES "${INSTALL_EXTRA_BINARIES}\n  File \"${file}\"")
ENDFOREACH()

SET(REGISTER_EXTENSION_NSH "@CMAKE_SOURCE_DIR@/packaging/windows/registerExtension.nsh")
TO_NATIVE_PATH("${REGISTER_EXTENSION_NSH}" REGISTER_EXTENSION_NSH)

SET(LICENSE_FILE "@LICENSE_FILE@")
TO_NATIVE_PATH("${LICENSE_FILE}" LICENSE_FILE)

SET(INSTALLER_FILENAME "@INSTALLER_FILENAME@")

# These are passed at runtime, not at configure time.
IF(SCANTAILOR_EXE)
	TO_NATIVE_PATH("${SCANTAILOR_EXE}" SCANTAILOR_EXE)
ENDIF()
IF(SCANTAILOR_CLI_EXE)
	TO_NATIVE_PATH("${SCANTAILOR_CLI_EXE}" SCANTAILOR_CLI_EXE)
ENDIF()
IF(CRASHREPORTER_EXE)
	TO_NATIVE_PATH("${CRASHREPORTER_EXE}" CRASHREPORTER_EXE)
ENDIF()

SET(STAGING_DIR "@CMAKE_BINARY_DIR@/staging")
TO_NATIVE_PATH("${STAGING_DIR}" STAGING_DIR)

SET(SIZEOF_VOID_PTR "@CMAKE_SIZEOF_VOID_P@")

CONFIGURE_FILE(
	"@CMAKE_SOURCE_DIR@/packaging/windows/scantailor.nsi.in"
	"@CMAKE_BINARY_DIR@/scantailor.nsi" @ONLY
)